package ocean.chinacraft.common;

import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import ocean.chinacraft.common.constants.Constants;
import ocean.chinacraft.common.tileentity.function.FurnacePlatformBlockTile;
import ocean.chinacraft.common.tileentity.function.JadeWorkbenchBlockTile;
import ocean.chinacraft.common.tileentity.function.SericultureFrameBlockTile;

/**
 * 方块Tile
 *
 * @author zhang
 * @since 2021/11/15
 */
public class ModTileEntity {

    public static DeferredRegister<TileEntityType<?>> TILE_ENTITY =
            DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, Constants.MOD_ID);

    /**
     * 灶台
     */
    public static RegistryObject<TileEntityType<FurnacePlatformBlockTile>> FURNACE_PLATFORM_BLOCK_TILE =
            TILE_ENTITY.register("furnace_platform_block_tile", () -> TileEntityType.Builder.of(
                    FurnacePlatformBlockTile::new, ModBlocks.FURNACE_PLATFORM_BLOCK.get()).build(null));

    /**
     * 玉石工作台
     */
    public static RegistryObject<TileEntityType<JadeWorkbenchBlockTile>> JADE_WORKBENCH_BLOCK_TILE =
            TILE_ENTITY.register("jade_workbench_block_tile", () -> TileEntityType.Builder.of(
                    JadeWorkbenchBlockTile::new, ModBlocks.JADE_WORKBENCH_BLOCK.get()).build(null));

    /**
     * 养蚕架
     */
    public static RegistryObject<TileEntityType<SericultureFrameBlockTile>> SERICULTURE_FRAME_BLOCK_TILE =
            TILE_ENTITY.register("sericulture_frame_block", () -> TileEntityType.Builder.of(
                    SericultureFrameBlockTile::new, ModBlocks.SERICULTURE_FRAME_BLOCK.get()).build(null));

    public static void register(IEventBus bus) {
        TILE_ENTITY.register(bus);
    }
}
